package com.guigu.www.mapper;

import com.guigu.www.pojo.Menu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author DengHao
 * @since 2021-10-20
 */
public interface MenuMapper extends BaseMapper<Menu> {

    @Select("SELECT * FROM menu WHERE menu_state=0 and menu_id IN (SELECT menu_id FROM role_menu WHERE role_id=#{roleId})")
    List<Menu> showUserMenu(@Param("roleId") Integer roleId);

}
